# sprite = codesters.Rectangle(x, y, width, height, "color")
start = codesters.Rectangle(0, -250, 500, 50, "red")
# sprite = codesters.Rectangle(x, y, width, height, "color")
finish = codesters.Rectangle(0, 250, 500, 50, "green")
my_list = [-150, -50, 50, 150]
for value in my_list:
pass # delete after adding indented code
# add code here
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, value, 100, 50, "blue")
t = codesters.Teacher()
rects = t.find_function("Rectangle")
sprites = t.find_function("Sprite")
try:
tval1 = rects[2][1].lower().replace(' ','')
tval1_indent = t.get_indent_at_line(rects[2][0])
except:
tval1 = "DNE"
tval1_indent = "DNE"
try:
tval2 = sprites[0][1].lower().replace(' ','')
tval2_indent = t.get_indent_at_line(sprites[0][0])
except:
tval2 = "DNE"
tval2_indent = "DNE"
t1 = TestObjective()
t1.add_success('rectangle(0,value,500,50,"gray")' in tval1, "Great Job!")
t1.add_failure(tval1 == "DNE", "Oops, did you delete the rectangle in the loop?")
t1.add_failure(tval1 != "DNE" and '(0,value,500,' not in tval1, "Did you change the width for the rectangle from 100 to 500?")
t1.add_creative(tval1 != "DNE" and 'rectangle(0,value,500,50,' in tval1 and '"gray")' not in tval1, "That's a good color too!")
t2 = TestObjective()
t2.add_success('sprite("codester",0,0)' in tval2 and tval2_indent == 0, "Great job!")
t2.add_failure(tval2 == "DNE", "Did you add a Sprite at Position at the bottom of the program?")
t2.add_failure(tval2 != "DNE" and 'sprite("codester",0,0)' not in tval2, "Are you sure you added a Sprite at Position?")
t2.add_failure('sprite("codester",0,0)' in tval2 and tval2_indent != 0, "Make sure Sprite at Position is NOT indented!")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()